<%--
  Created by IntelliJ IDEA.
  User: zslajchrt
  Date: 6.3.11
  Time: 16:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/javascript;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

MyDesktop.ScenariosMenuModule = Ext.extend(MyDesktop.ScenariosModule, {
    init : function() {
        MyDesktop.ScenariosMenuModule.superclass.init.call(this);
    },

    initModule : function(app) {

        this.launcher = {
            text: 'Scenarios',
            iconCls: 'bogus',
            handler: function() {
                return false;
            },
            menu: {
                items:[
                    <c:forEach items="${sessionScope['chloroform.ConfigPageRegisterLookup'].scenarios}" var="scenario"
                    varStatus="loopStatus">
                        <c:if test="${loopStatus.index > 0}">,</c:if>
                        {
                            <c:choose>
                            <c:when test="${scenario eq ''}">text: 'Default',</c:when>
                            <c:otherwise>text: '${scenario}',</c:otherwise>
                            </c:choose>
                            iconCls:'bogus',
                            handler : this.createWindow,
                            scope: this,
                            windowId: 'scenario-${scenario}',
                            scenario: '${scenario}',
                            paracol: app.paracol,
                            projectModelUrl: '../project/',
                        }
                    </c:forEach>

                    <c:forEach items="${sessionScope['chloroform.ConfigPageRegisterLookup'].metaScenarios}" var="scenario"
                    varStatus="loopStatus">
                        ,
                        {
                            <c:choose>
                            <c:when test="${scenario eq ''}">text: 'Default [Meta]',</c:when>
                            <c:otherwise>text: '${scenario} [Meta]' ,</c:otherwise>
                            </c:choose>
                            iconCls:'bogus',
                            handler : this.createWindow,
                            scope: this,
                            windowId: 'meta-scenario-${scenario}',
                            scenario: '${scenario}',
                            paracol: app.metaParacol,
                            projectModelUrl: '../metaProject/',
                        }
                    </c:forEach>
                ]
            }
        }
    }
});